<template>
  <div class="init_main">
    <p class="name_sty">{{ name }}</p>
    <div>
      <el-date-picker
        v-model="query.year"
        type="year"
        value-format="yyyy"
        format="yyyy 年"
        placeholder="选择年"
      >
      </el-date-picker>
      <el-select v-model="query.quarter" placeholder="请选择季度">
        <el-option label="1季度" value="1"> </el-option>
        <el-option label="2季度" value="2"> </el-option>
        <el-option label="3季度" value="3"> </el-option>
        <el-option label="4季度" value="4"> </el-option>
      </el-select>
      <el-button icon="el-icon-search" @click="getList2"></el-button>
      <el-button @click="upload_table">导出</el-button>
    </div>
    <div class="table">
      <el-table
        :data="tableData2"
        border
        style="width: 100%"
        height="750"
        highlight-current-row
        @current-change="row_click"
      >
        <el-table-column prop="科室" label="科室"> </el-table-column>
        <el-table-column prop="分级护理" label="分级护理"> </el-table-column>
        <el-table-column prop="优质护理" label="中药中医护理">
        </el-table-column>
        <el-table-column prop="基础护理" label="基础(优质)护理">
        </el-table-column>
        <el-table-column prop="护理文书" label="护理文书"> </el-table-column>
        <!-- <el-table-column prop="消毒隔离" label="消毒隔离"> </el-table-column> -->
        <el-table-column prop="护理安全管理" label="护理安全管理">
        </el-table-column>
        <el-table-column prop="病区管理" label="病区管理"> </el-table-column>
        <!-- <el-table-column prop="围手术期护理" label="围手术期护理">
        </el-table-column>
        <el-table-column label="护理应急管理">
          <el-table-column prop="急救技能" label="急救技能"> </el-table-column>
          <el-table-column prop="急救药物品" label="急救药物品">
          </el-table-column>
        </el-table-column> -->
        <el-table-column prop="特殊科室护理质量" label="特殊科室护理质量">
        </el-table-column>
        <el-table-column prop="护理服务满意度" label="护理服务满意度">
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      name: "",
      tableData: [],
      tableData2: [],
      query: {
        year: "",
        quarter: "",
      },
    };
  },
  mounted() {
    this.name = this.$route.meta.title;
  },
  methods: {
    getList2() {
      this.$get(
        "/Task/QualityControlTableQuarter/" +
          this.query.year +
          "/" +
          this.query.quarter
      ).then((res) => {
        if (res.StatusCode != 200) {
          this.$notify.error({
            title: "错误",
            message: res.Errors,
          });
          return;
        }
        this.tableData2 = res.Data;
      });
    },
    upload_table() {
      this.$get(
        "/Task/ExportQualityControlTableQuarter/" +
          this.query.year +
          "/" +
          this.query.quarter
      ).then((res) => {
        window.open(baseUrl.bsIp + res.Data);
      });
    },
    row_click(row) {
      this.section = row.Name;
    },
    goto_da(val) {
      console.log(val);
      this.$router.push(
        "/RYDA/daxx?人员ID=" +
          val._id +
          "&人员姓名=" +
          val.Data.姓名 +
          "&按钮权限=true"
      );
    },
  },
};
</script>

<style scoped lang='scss'>
.init_main {
  background-color: #fff;
  height: calc(100vh - 60px);
  border: 1px solid #333;
  border-radius: 5px;
  margin: 5px;
  padding: 10px;
  font-family: "FangSong";
  color: #000;
  .name_sty {
    color: #000;
    font-weight: 700;
    font-size: 18px;
    font-family: "FangSong";
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
  }
  .table {
    margin-top: 15px;
  }
  .page {
    text-align: right;
  }
}
::v-deep .el-table__body tr.current-row > td.el-table__cell {
  background-color: rgb(208, 229, 250);
  color: rgb(65, 158, 255);
  font-weight: 700;
}
.tac {
  text-align: center;
}
</style>